Visige::Application.routes.draw do |map| 
  
  get "privacy/edit"

  get "privacy/update"

  controller :sessions do
  	get 'login' => :new
  	post 'login' => :create
  	delete 'logout' => :destroy
  end
  
  match 'logout' => "Sessions#destroy", :as => 'logout'

  get "splash/login"
  root :to => "splash#login"

  resources :popsicles 
  resources :entities

  map.resource :entities, :collection => { :create_public_popsicle => :post}
  map.resource :entities, :collection => { :create_private_popsicle => :post}
  
  map.resource :privacies, :collection => { :update => :post}
  match 'Privacy/edit' => "Privacies#edit", :as => 'edit_privacy'

  match 'feed/:id' => "Entities#feed", :as => 'feed'
  
  match 'User/new' => "Entities#new_user", :as => 'new_user'
  match 'Group/new' => "Entities#new_group", :as => 'new_group'
  
  map.connect 'change_colour_scheme', :controller => 'entities', :action => 'change_colour_scheme'
  
  map.resource :entities, :collection => { :send_feedback => :post }
  
  match 'feedback_form/:id' => "Entities#feedback_form", :as => 'feedback_form'
  
  match 'css_settings_form/:id' => "Entities#css_settings_form", :as => 'css_settings_form'
  
  match 'html_chat/:id' => "Entities#html_chat", :as => 'html_chat'
  
  match 'recent_activity/:id' => "Entities#recent_activity", :as => 'recent_activity'
  
  match 'show_friend/:id' => "Entities#show_friend", :as => 'show_friend'
  
  match 'change_password/:id' => "Entities#change_password", :as => 'change_password'
  
  match 'friend_requests/:id' => "Entities#friend_requests_received", :as => 'friend_requests'
  
  match 'accept_friend_request/:id' => "Entities#accept_friend_request", :as => 'accept_friend_request'
  
  match 'deny_friend_request/:id' => "Entities#deny_friend_request", :as => 'deny_friend_request'
  
  match 'block_friend_request/:id' => "Entities#block_friend_request", :as => 'block_friend_request'
  
  match 'remove_friend_request/:id' => "Entities#remove_friend_request", :as => 'remove_friend_request'
  
  match 'add_friend/:id' => "Entities#add_friend", :as => 'add_friend'
  
  match 'view_private_messages/:id' => "Popsicles#show", :as => 'view_private_messages' 
  
  match 'view_sent_messages/:id' => "Popsicles#show_sent", :as => 'view_sent_messages'
  
  match 'send_private_messages/:id' => "Popsicles#new", :as => 'send_private_messages'
  
  match 'send_group_messages/:id' => "Popsicles#new_to_group", :as => 'send_group_messages'
  
  match 'search/:search' => "Entities#search", :as => 'search_friends'
  
  match 'create_public_response/:popsicle' => "Popsicles#show_public_response", :as => 'create_public_response'
  
  match 'create_private_response/:popsicle' => "Popsicles#show_private_response", :as => 'create_private_response'
  
  match 'organise_friends' => "Entities#organise_friends", :as => 'organise_friends'
  match 'create_friend_group' => "Entities#new_puddle", :as => 'new_puddle'

  match 'remove_from_group/:clique_id/:member_id' => "Entities#remove_from_group", :as => 'remove_from_group'

  map.connect 'create_private_popsicle_for_group', :controller => 'entities', :action => 'create_private_popsicle_for_group'

  map.connect 'add_to_group', :controller => 'entities', :action => 'add_to_group'

  map.connect 'create_puddle', :controller => 'entities', :action => 'create_puddle'
  
  map.resource :popsicles, :collection => { :create_public_response => :post}
  
  map.resource :popsicles, :collection => { :create_private_response => :post}
  
  # The priority is based upon order of creation:
  # first created -> highest priority.

  # Sample of regular route:
  #   match 'products/:id' => 'catalog#view'
  # Keep in mind you can assign values other than :controller and :action

  # Sample of named route:
  #   match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
  # This route can be invoked with purchase_url(:id => product.id)

  # Sample resource route (maps HTTP verbs to controller actions automatically):
  #   resources :products

  # Sample resource route with options:
  #   resources :products do
  #     member do
  #       get 'short'
  #       post 'toggle'
  #     end
  #
  #     collection do
  #       get 'sold'
  #     end
  #   end

  # Sample resource route with sub-resources:
  #   resources :products do
  #     resources :comments, :sales
  #     resource :seller
  #   end

  # Sample resource route with more complex sub-resources
  #   resources :products do
  #     resources :comments
  #     resources :sales do
  #       get 'recent', :on => :collection
  #     end
  #   end

  # Sample resource route within a namespace:
  #   namespace :admin do
  #     # Directs /admin/products/* to Admin::ProductsController
  #     # (app/controllers/admin/products_controller.rb)
  #     resources :products
  #   end

  # You can have the root of your site routed with "root"
  # just remember to delete public/index.html.
  # root :to => "welcome#index"


  
  # See how all your routes lay out with "rake routes"

  # This is a legacy wild controller route that's not recommended for RESTful applications.
  # Note: This route will make all actions in every controller accessible via GET requests.
  # match ':controller(/:action(/:id(.:format)))'
end
